
* Open dataset
use "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\main_dataset_corrected.dta", clear
set scheme s1mono

* Standardize PGIs
su PGI_DEP_multi
gen PGI_depression = (PGI_DEP_multi-r(mean))/r(sd)

su PGI_NEURO_multi
gen PGI_neuro = (PGI_NEURO_multi-r(mean))/r(sd)

su PGI_SELFHEALTH_multi
gen PGI_srh = (PGI_SELFHEALTH_multi-r(mean))/r(sd)


* Main results
reg r2018voter PC* i.BirthYear##c.Sex c.PGI_depression##c.educationYearsHi2018 c.PGI_depression##c.PC* c.PC*#c.educationYearsHi2018, cluster(LopNrParID)
outreg2 using "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\PGI paper\interaction.tex", replace label tex(frag) dec(3) 2aster
marhis educationYearsHi2018, mar(PGI_depression)

reg e2019voter PC* i.BirthYear##c.Sex c.PGI_depression##c.educationYearsHi2018 c.PGI_depression##c.PC* c.PC*#c.educationYearsHi2018, cluster(LopNrParID)
outreg2 using "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\PGI paper\interaction.tex", append label tex(frag) dec(3) 2aster
marhis educationYearsHi2018, mar(PGI_depression)

* Robustness with other PGIs
reg r2018voter PC* i.BirthYear##c.Sex c.PGI_neuro##c.educationYearsHi2018 c.PGI_neuro##c.PC* c.PC*#c.educationYearsHi2018, cluster(LopNrParID)
outreg2 using "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\PGI paper\interaction.tex", append label tex(frag) dec(3) 2aster
reg r2018voter PC* i.BirthYear##c.Sex c.PGI_srh##c.educationYearsHi2018 c.PGI_srh##c.PC* c.PC*#c.educationYearsHi2018, cluster(LopNrParID)
outreg2 using "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\PGI paper\interaction.tex", append label tex(frag) dec(3) 2aster
reg e2019voter PC* i.BirthYear##c.Sex c.PGI_neuro##c.educationYearsHi2018 c.PGI_neuro##c.PC* c.PC*#c.educationYearsHi2018, cluster(LopNrParID)
outreg2 using "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\PGI paper\interaction.tex", append label tex(frag) dec(3) 2aster
reg e2019voter PC* i.BirthYear##c.Sex c.PGI_srh##c.educationYearsHi2018 c.PGI_srh##c.PC* c.PC*#c.educationYearsHi2018, cluster(LopNrParID)
outreg2 using "C:\Userdata\Shared\Dofiles\PrelDoFiles\PrelRafael\PGI paper\interaction.tex", append label tex(frag) dec(3) 2aster





